import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';


import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
// ReactDOM.render(<DatePicker />, document.getElementById('root'));


ReactDOM.render(
  <React.StrictMode>
    <App msg="s13221321" />
  </React.StrictMode>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

import React from 'react';
import './App.css';
import {DatePicker} from 'antd';
import Test from './hooks/Test'

export default class App extends React.Component {

  constructor(props) {
    super(props);
    this.state = {isToggleOn: true, date: '2020-11-10'};
    // 为了在回调中使用 `this`，这个绑定是必不可少的
    this.handleClick = this.handleClick.bind(this);
  }

  handleClick() {
    this.setState(state => ({
      isToggleOn: !state.isToggleOn,
      date: '我被修改了date'
    }));
    new Test().handleClick()
  }

  render() {
    const onFinish = (values) => {
      console.log('Success:', values);
    };

    const oninishFailed = (errorInfo) => {
      console.log('Failed:', errorInfo);
    };

    return (
      <div className='app'>
        <Test msg="测试传数据"></Test>
        <DatePicker/>
      </div>
    )
  }
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

import React from 'react';

export default class Test extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      name:'张三',
      age:30
    }

    this.handleClick = this.handleClick.bind(this)
  }

  handleClick(){
    console.log('@@@:', 123);
  }

  render() {
    return (
      <div>
        <h1>Test组件---{this.props.msg}</h1>
        <button onClick={this.handleClick}>test组件事件</button>
      </div>
    )
  }
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
